<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<title>三七物联管理平台</title>
	<link rel="stylesheet" type="text/css" href="/home/css/rude.css">
	<!-- <link href="favicon.ico" type="image/x-icon" rel="icon"> -->
	<link rel="stylesheet" href="/home/css/common.css">
<script type="text/javascript" src="/home/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="/home/js/alertPopShow.js"></script>
	<link href="iTunesArtwork@2x.png" sizes="114x114" rel="apple-touch-icon-precomposed">
	<style type="text/css">
		.c-float-popWrap.show{
			top:80px !important;
		}
		.btn-confirm{
			position:absolute;
			left:50%;
			margin-left:-87px;
		}
		.aui-btn-item{
              margin-top:10%;
              position:relative;
		}
	</style>
</head>
<body>
	  	<div class="aui-container">
			{{csrf_field()}}

		<div class="aui-page">
			<div class="header header-color">
				<div class="header-background"></div>
				<div class="toolbar statusbar-padding">
					<button class="bar-button back-button"  onclick="history.go(-1);"><i class="icon icon-back-sx"></i></button>
					<div class="header-title">
						<div class="title">安全中心</div>
					</div>
				</div>
			</div>
			<div class="aui-text-top aui-l-content aui-l-content-clear">
				<div class="devider b-line"></div>
				<div class="aui-menu-list aui-menu-list-clear">
				<ul>
					<li class="b-line" id="mt">
						<a href="/home/mine/touxiang">
							<div class="aui-icon"><img src="/home/images/rude-png/icon-read8.png"></div>
							<h3>修改头像</h3>                             
							<span style="bottom: 3px"><img src="{{$info['n_img']}}" style="width: 50px;height: 50px;display: block;border-radius: 50%;"></span>
							<div class="aui-time"><i class="aui-jump"></i></div>
						</a>
					</li>
					<li class="b-line">
						<a href="/home/mine/change">
							<div class="aui-icon"><img src="/home/images/rude-png/icon-read10.png"></div>
							<h3>修改密码</h3>                             
							<span>账号安全</span>
							<div class="aui-time"><i class="aui-jump"></i></div>
						</a>
					</li>
					<li class="b-line" id="demo4">
						<!-- <a href="/home/mine/nlist"> -->
							<div class="aui-icon"><img src="/home/images/rude-png/icon-read9.png"></div>
							<h3>修改昵称</h3>
							<span class="aui-an-red" id="nc" style="color: #f76160;text-align: right;display: inline-block;position: absolute;right: 45px;bottom: 16px;">{{$info['name']}}</span>
							<div class="aui-time"><i class="aui-jump"></i></div>
					</li>
					
					<li class="b-line">
						<a href="javascript:;">
							<div class="aui-icon"><img src="/home/images/rude-png/icon-read5.png"></div>
							<h3>设备管理</h3>
							<div class="aui-time"><i class="aui-jump"></i></div>
						</a>
					</li>
				</ul>

				</div>

			</div>

		</div>
		<a href="/home/login/index">
		  <div class="aui-btn-item" style="">
				<a href="/home/mine/logout" onclick="return confirm('确认退出！')" class="btn btn-confirm" style=" ">退出登录</a>
			</div>
		</a>	
	</div>

</body>
	 <script type="text/javascript" src="/home/js/jquery.js"></script>
	<script type="text/javascript">
		 $('#demo4').on('click', function(){
		var html = "<label >昵称：<input class='confirm_input' placeholder='15个字符以内...'></label>";
		popTipShow.confirm('请输入昵称',html,['确 定','取 消'],
			function(e){
			  //callback 处理按钮事件
			  var button = $(e.target).attr('class');
			  if(button == 'ok'){
				if(null==$(".confirm_input").val() || ""==$(".confirm_input").val()){
					webToast("昵称不能为空！","top", 500);
					return;

				}	
				
				this.hide();
				// setTimeout(function() {
				// 	webToast($(".confirm_input").val(),"conter", 500);
					 
				// }, 300);
				
				//按下确定按钮执行的操作
				//todo ....

                      $.ajax({
                      type: 'POST',
                      url: "/home/mine/nickname",
                      data:{
                          'nike':$(".confirm_input").val(),
						  '_token':$('input[name=_token]').val()
					  },
                      dataType: 'json',
                      success: function(data){
                      	// alert(111)
                          if(data.status ==1){
                          	// alert(222)
                             // $('#nc').text() == $(".confirm_input").val(),
                             // webToast("修改成功","bottom", 3000);
                          }



                      }
                  });

                  setTimeout(function() {
                      webToast("修改成功","top", 500);
                  }, 300);
			  }

			  if(button == 'cancel') {
				//按下取消按钮执行的操作
				//todo ....
				this.hide();
				// setTimeout(function() {
				// 	// webToast(2000);
				// }, 300);
			  }
			}
		);
   });
	</script>
</html>